package us.gaaoc.framework.dao;

import java.util.List;

import us.gaaoc.framework.model.CaseRecord;
import us.gaaoc.framework.model.DocumentStatus;
import us.gaaoc.framework.model.Documents;
import us.gaaoc.framework.model.util.DocumentsCountByType;
import us.gaaoc.framework.model.util.DocumentsCountPerMonth;

public interface DocumentsDAO extends GenericDAO<Documents, String>{
	
	public abstract List<Documents> findDocumentsByCaseUuid(String caseUuid);
	public abstract Documents findDocumentsByInstanceAndCaseUuid(String docInstanceCode, String caseUuid);
	public abstract void updateDocumentStatus(String uuid, DocumentStatus status);
	public abstract List<Documents> findDocumentsByDocStatusCode(int code);
	
	//added by Sukhada on 23th Oct 06
	public abstract List<Documents> findDocumentsbyMaxVersion(String caseRecordUuid);
	public abstract List<Documents> getPDFDocuments(String caseRecordUuid);
	public abstract void removeDocumentFromListByCaseRecordUuidAndDocumentInstanceCode(String caseRecordUuid, String documentTypeCode);
	
	public abstract void enableDocDeleteFlag(Documents doc);

	/**
	 * @param doc
	 */
	public abstract void deleteDocument(Documents doc);
	
	/**
	 * This query returns the number of documents of a case record in GAJE system that are imported in the local cms
	 * This number is needed in order to import an additional document
	 * @param caseRecord
	 * @return number of documents already imported into CMS of aC case record 
	 */
	public int findTheNumberOfDocumentsAlreadyImportedIntoCMSOfACaseRecord(CaseRecord caseRecord);
	//added by Bhawana
	public abstract int countDocuments();
	public abstract int countDocumentsByCategoryExcludingDataFiles();
	public abstract List<DocumentsCountPerMonth> countDocumentsByMonth();
	public abstract List<DocumentsCountByType> countDocumentsByType();
		
	/**
	 * change the status of a document
	 * @param docUuid
	 * @param docStatus
	 */
	public abstract void UpdateDocumentByStatus(String docUuid, DocumentStatus docStatus);
	
	/**
	 * This method returns the text document for the given caseReocrd.
	 * @param caseUuid
	 * @return
	 */
	public abstract Documents getTextDocument(String caseUuid);
	
	/**
	 * This method return all documents.
	 * 
	 * @param record the row to be pulled back.
	 */
	public abstract List<Documents> findAll(int record);
	
}
